# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
  inputs,
  outputs,
  lib,
  config,
  pkgs,
  names,
  timeZone,
  version,
  unfree,
  ...
}: {
  system.stateVersion = version;

  imports = [
    ./bluetooth.nix
    ./boot.nix
    ./console.nix
    ./editor.nix
    ./hardware-configuration.nix
    ./hidpi.nix
    ./networking.nix
    ./nix.nix
    ./programs.nix
    ./security.nix
    ./sound.nix
    ./systemd.nix
    ./video.nix
    ./virtualisation.nix
    ./x11.nix
    inputs.home-manager.nixosModules.home-manager
  ];

  time.timeZone = timeZone;

  nixpkgs.config.allowUnfreePredicate = unfree.predicate;

  home-manager = {
    extraSpecialArgs = { inherit inputs outputs names version unfree; };
    users.${names.users.admin} = import ../home-manager/home.nix;
  };

  environment.etc =
    lib.mapAttrs' (name: value: {
      name = "nix/path/${name}";
      value.source = value.flake;
    }) config.nix.registry;

  users.users.${names.users.admin} = {
    extraGroups = [ "wheel" ];
    isNormalUser = true;
    shell = pkgs.zsh;
  };
}
